package com.ruoyi.pyo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pyo.mapper.PetYeahBannerMapper;
import com.ruoyi.pyo.domain.PetYeahBanner;
import com.ruoyi.pyo.service.IPetYeahBannerService;

/**
 * bannerService业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class PetYeahBannerServiceImpl implements IPetYeahBannerService 
{
    @Autowired
    private PetYeahBannerMapper petYeahBannerMapper;

    /**
     * 查询banner
     * 
     * @param id banner主键
     * @return banner
     */
    @Override
    public PetYeahBanner selectPetYeahBannerById(Long id)
    {
        return petYeahBannerMapper.selectPetYeahBannerById(id);
    }

    /**
     * 查询banner列表
     * 
     * @param petYeahBanner banner
     * @return banner
     */
    @Override
    public List<PetYeahBanner> selectPetYeahBannerList(PetYeahBanner petYeahBanner)
    {
        return petYeahBannerMapper.selectPetYeahBannerList(petYeahBanner);
    }

    /**
     * 新增banner
     * 
     * @param petYeahBanner banner
     * @return 结果
     */
    @Override
    public int insertPetYeahBanner(PetYeahBanner petYeahBanner)
    {
        petYeahBanner.setCreateTime(DateUtils.getNowDate());
        return petYeahBannerMapper.insertPetYeahBanner(petYeahBanner);
    }

    /**
     * 修改banner
     * 
     * @param petYeahBanner banner
     * @return 结果
     */
    @Override
    public int updatePetYeahBanner(PetYeahBanner petYeahBanner)
    {
        petYeahBanner.setUpdateTime(DateUtils.getNowDate());
        return petYeahBannerMapper.updatePetYeahBanner(petYeahBanner);
    }

    /**
     * 批量删除banner
     * 
     * @param ids 需要删除的banner主键
     * @return 结果
     */
    @Override
    public int deletePetYeahBannerByIds(Long[] ids)
    {
        return petYeahBannerMapper.deletePetYeahBannerByIds(ids);
    }

    /**
     * 删除banner信息
     * 
     * @param id banner主键
     * @return 结果
     */
    @Override
    public int deletePetYeahBannerById(Long id)
    {
        return petYeahBannerMapper.deletePetYeahBannerById(id);
    }
}
